package com.example.spgl.service.impl;

import com.example.spgl.mapper.UserMapper;
import com.example.spgl.service.UserService;
import com.example.spgl.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;


    @Override
    public User findByUsername(String Username) {
        User u = userMapper.findByUsername(Username);
        return u;
    }

    @Override
    public void register(String username, String password, String name) {

        userMapper.add(username,password,name);

    }

    @Override
    public Integer selectCount() {
        return userMapper.selectcount();
    }
}
